import pymysql

db = pymysql.connect(host="localhost", user="sunck", passwd="123456789", database="sunck")

cursor = db.cursor()

# 检查表是否存在，如果存在则删除
cursor.execute("drop table if exists bandcard")

# 建表
sql = 'create table bandcard(id int auto_increment primary key, money int not null)'
cursor.execute(sql)

cursor.close()
db.close()